#pragma once

#include "Transform.h"
#include "TRSTransform.h"
#include "QuaternionTransform.h"
#include <vector>
using namespace std;
/**
* This class maintains a list of transforms. There are also 
* a number of convenience methods to create commonly used transforms
* (translation, rotation, ...)
* @author Koen Samyn
*/
class TransformList: public Transform
{
public:
	/**
	* Creates a new TranformList object
	*/
	TransformList(void);
	/**
	* Destroys the TransformList object.
	*/
	virtual ~TransformList(void);
	
	/**
	* Add a transform to the list of transforms.
	* @param transform the Transform object to add.
	*/ 
	void AddTransform(Transform* transform){m_Transforms.push_back(transform);}
	/**
	* Add a translation transform to the list of transforms.
	* @param x the x translation value.
	* @param y the y translation value.
	* @param z the z translation value.
	* @return the created Transfom object. This is useful when you want
	* to change the parameters of the transform each tick.
	*/
	Transform* AddTranslationTransform(float x, float y, float z);
	/**
	* Add a rotation transform to the list of transforms.
	* @param rotx the rotation around the x axis.
	* @param roty the rotation around the y axis.
	* @param rotz the rotation around the z axis.
	* @return the transform that was added. This is useful when you want
	* to change the parameters of the transform each tick.
	*/
	Transform* AddRotationTransform(float rotx, float roty, float rotz);
	/**
	* Adds a quaternion transform to the list of transforms.
	* @param x the x value for the axis.
	* @param y the y value for the axis.
	* @param z the z value for the axis.
	* @param angle the angle for the rotation.
	* @return the transform that was added. This is useful when you want
	* to change the parameters of the transform each tick.
	*/
	Transform* AddQuaternionTransform(float x, float y, float z, float angle);
	/**
	* This method checks all the transforms in the list to see if
	* they were changed. If none were changed, the m_CompiledMatrix needs
	* no recalculation.
	*/
	bool IsChanged() const;
	/**
	* Resets the parameters of the transform.
	* Clears and deletes the transform list(be careful)
	*/
	void ResetTransformParameters();
	/**
	* Recalculates the matrix
	*/
	void RecalculateMatrix() const;
protected:
	
private:
	vector<Transform*> m_Transforms;
	// -------------------------
	// Disabling default copy constructor and default assignment operator.
	// If you get a linker error from one of these functions, your class is internally trying to use them. This is
	// an error in your class, these declarations are deliberately made without implementation because they should never be used.
	// -------------------------
	TransformList(const TransformList& t);
	TransformList& operator=(const TransformList& t);
};
